#include <iostream>
#include <cstring>
#include <vector>
using namespace std;
class Solution {
public:
	void reverseString(vector<char>& s) {
		for (int i = 0, j = s.size() - 1; i < s.size()/2; i++, j--) {
			swap(s[i],s[j]);
		}
	}
};
class Test {
public:
	void reverseString(vector<char>& s){
		int l = 0;
		int r = s.size() - 1;
		while(l < r){
			s[l] ^= s[r];
			s[r] ^= s[l];
			s[l] ^= s[r];
			l++;
			r--;
		}
	}
};



int main(){
	Test test;
//	string a = "asagsdf";
	vector<char> a{'a','s','a','g','s','d','f'};
	test.reverseString(a);
	for(int i = 0;i <a.size();i++){
		cout << a[i] << " ";
	}
	cout << endl;
	return 0;
}


